package collention;

import java.util.ArrayList;
import java.util.Collection;


public class CollectionDemo {
    public static void main(String[] args) {
        /*Collection C=new ArrayList();
        C.add("one");
        C.add("two");
        C.add("there");
        C.add("four");
        System.out.println(C);

        Collection D=new ArrayList();
        D.add("1");
        D.add("2");
        D.add("3");
        D.add("4");
        D.add("5");
        System.out.println(D);
        System.out.println("sizs"+C.size());
        System.out.println("“是否为空集"+C.isEmpty());
        C.clear();
        System.out.println("集合已清空");
        System.out.println(C);*/
        Collection c=new ArrayList();
        c.add(new Point(1,2));
        c.add(new Point(3,4));
        c.add(new Point(5,7));
        c.add(new Point(6,8));
        c.add(new Point(9,10));
        System.out.println(c);
        Point p=new Point();
        boolean contains=c.contains(p);
        System.out.println("是否包含"+contains);
        c.remove(p);
        System.out.println(c);

        Collection cc=new ArrayList();
        Point pp=new Point(1,2);
        cc.add(pp);
        System.out.println("PP"+pp);
        System.out.println("cc"+cc);
        pp.setX(100);
        System.out.println("PP"+pp);
        System.out.println("cc"+cc);































    }
}
